package com.yykj.prescription.server.model.entity.prescription;

import com.yykj.prescription.client.enums.PrescriptionType;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;

import javax.persistence.*;
import java.time.LocalDateTime;

@Data
@Entity
public class Prescription {
    @Id
    @ApiModelProperty("处方ID")
    private String prescriptionId;

    @ApiModelProperty("医院ID")
    private Integer hospitalId;

    @ApiModelProperty("医生ID")
    private String doctorId;

    @ApiModelProperty("医生腾讯ID")
    private String doctorTencentId;

    @ApiModelProperty("医生名称")
    private String doctorName;

    @ApiModelProperty("用户ID")
    private String userId;

    @ApiModelProperty("就诊人ID")
    private String patientId;

    @ApiModelProperty("就诊人卡号")
    private String patientCardNo;

    @ApiModelProperty("就诊人名称")
    private String patientName;

    @ApiModelProperty("患者姓名拼音")
    private String patientNamePy;

    @ApiModelProperty("就诊人年龄")
    private String patientAge;

    @ApiModelProperty("就诊人性别")
    private String patientSex;

    @ApiModelProperty("就诊人科室名称")
    private String depName;

    @ApiModelProperty("就诊人科室ID")
    private Integer depId;

    @ApiModelProperty("处方来源,1：互联网医院")
    private Integer origin = 1;

    @ApiModelProperty("诉求")
    @Column(length = 2000)
    private String appeal;

    @ApiModelProperty("诊断及处理意见")
    @Column(length = 2000)
    private String conclusion;

    @ApiModelProperty("处方类型 west 西药方，china 中药方")
    @Enumerated(EnumType.STRING)
    private PrescriptionType type;

    @ApiModelProperty("处方当前状态：1未审核，2已审核，3已失效，4作废,5已流转")
    private Integer status = 1;

    @ApiModelProperty("中药处方需要输入地址信息")
    @Column(length = 500)
    private String address;

    @ApiModelProperty("创建时间")
    @CreationTimestamp
    private LocalDateTime addTime;

    @ApiModelProperty("处方审核时间")
    private LocalDateTime checkTime;

    @ApiModelProperty("处方失效时间")
    private LocalDateTime expireTime;

    @ApiModelProperty("处方作废时间")
    private LocalDateTime disableTime;

    @ApiModelProperty("流转时间")
    private LocalDateTime transTime;

    @ApiModelProperty("审核方式，1自动审核 2人工审核")
    private Integer checkType = 1;

    @ApiModelProperty("是否永久有效,true 永久生效 ")
    private Boolean forever = Boolean.TRUE;

    @ApiModelProperty("是否无穷次数： true 无穷多次 ")
    private Boolean endless = Boolean.TRUE;

    @ApiModelProperty("剩余使用次数")
    private Integer cnt;

    @ApiModelProperty("流转后，处方是否可用，true 流转后可用，false 流转后不可用(默认)")
    private Boolean transAvailable = Boolean.FALSE;

    @ApiModelProperty("药品列表ids")
    @Column(length = 1000)
    private String drugIds;

}
